#ifndef MYLOGGER_H
#define MYLOGGER_H

// #include "commonutils_global.h"
#include <stdlib.h>
#include "spdlog/spdlog.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include "spdlog/sinks/daily_file_sink.h"
#include <vector>

namespace ns_yht
{

#ifndef GLOG
#define GLOG MyLogger::gLogger
#define GLOG_AIS MyLogger::gLogger_ais
#endif

    class /*COMMONUTILS_EXPORT*/ MyLogger
    {
    public:
        static void init();
        static spdlog::level::level_enum getGlobalLevel();
        static std::vector<spdlog::sink_ptr> createSinks(const std::string &log_file_name);
        static void createLogger(const std::string &dir_name, const std::string &logger_name, bool ais = false, bool debug = false);
        static std::shared_ptr<spdlog::logger> getLogger(const std::string &logger_name);

        static std::shared_ptr<spdlog::logger> gLogger;
        static std::shared_ptr<spdlog::logger> gLogger_ais;

        static void developInfo(const std::string &info);

        static bool developDebug;

    private:
        static spdlog::level::level_enum global_level;
    };

} // namespace ns_yht

#endif // MYLOGGER_H
